//
//  BadgeButton.m
//  MoneyIndividual
//
//  Created by Le Anh Tai on 1/1/14.
//  Copyright (c) 2014 Le Anh Tai. All rights reserved.
//

#import "BadgeButton.h"
#import <QuartzCore/QuartzCore.h>

@implementation BadgeButton

- (id)init
{
    self = [super init];
    
    if (self)
    {
        [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted];
        [self setTitleColor:[UIColor redColor] forState:UIControlStateSelected];
        
        self.backgroundColor = COLOR_RED_PURE;
    }
    
    return self;
}

- (void)setFrame:(CGRect)frame
{
    [super setFrame:frame];
    
    self.layer.cornerRadius = self.width/2;
}

- (void)setHighlighted:(BOOL)highlighted
{
    [super setHighlighted:highlighted];
    
    if (highlighted)
    {
        self.backgroundColor = COLOR_RED_DARK;
    }
    else
    {
        self.backgroundColor = COLOR_RED_PURE;
    }
}
@end
